<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<TITLE>${blogForm.title}</TITLE>
	<meta content="${blogForm.title}"  name="keywords"/>
	<meta content="${blogForm.title}" name="description" />
	<link href="${cpath}/css/youlin.css" rel="stylesheet" type="text/css" media="all" />

	<SCRIPT src="${cpath}/js/glk_array.js" type=text/javascript></SCRIPT>
	<SCRIPT src="${cpath}/js/glr_array.js" type=text/javascript></SCRIPT>
	<SCRIPT src="${cpath}/js/glfun.js"	   type=text/javascript></SCRIPT>

</head>
<body>
<script>
	var curreplyID = "";
</script>

<!--外套 start -->
<div class="wrap">
  <!--页首 start -->
	<%@ include file="/menu.jsp"%>
  <!--页首 end -->  
  
  <!--导航面包屑 start -->
  <div class="breadCrumb">
  <div class="breadCrumbNav">当前位置：<a href="${cpath}/users.do?action=main">我的主页</a> >> <a href="${cpath}/blog.do?action=list&qryUserID=${blogForm.userID}">日志列表</a> </div>
	<%@ include file="/navf.jsp"%>
 </div> 
  <!--导航面包屑 end -->
  
  <!--主体 start -->
 <div class="body">
   <div class="hotBox1">
     <div class="hotBox1-left">
       <div class="userInfo"> <img src="${cpath}/images/rich_text_format.png" width="75" height="75"  class="shequ icon user_icon_2"/>
         <p><b>${blogForm.title}</b></p>
         <p><span class="w70">${myfn:getUserNick(blogForm.userID)}</span><span class="w70">积分:${myfn:getUserIntegral(blogForm.userID)}</span></p>
       </div>
     </div>
     <div class="hotBox1-right">
		<p>&nbsp;</p>
       <c:if test="${ userID == blogForm.userID}">
	   <p><a href="${cpath}/blog.do?action=addPage&userID=${userID}"><img src="${cpath}/images/icon_21.gif" width="219" height="48" /></a></p>
	   </c:if>
     </div>
   </div>

   <div class="left-Box6">
   <h3><A href="${cpath}/blog_info/qryBlogID_${blogForm.blogID}.html">${blogForm.title}</A></h3>
   <div class="left-Box6-content">
   <div class="left-Box6-content-inner">     
      
   <form action="${cpath}/blog.do" name="theForm"  method="post" enctype="multipart/form-data" >
   <table class="bl-detail" width="95%" align="center" cellpadding="0" cellspacing="0" style="margin:0 auto;">  
     <tr class="bl-detail-top1">
       <td width="14%" height="34"><b class="color_red">楼主：<a href="${cpath}/users_home/userID_${blogForm.userID}.html">${myfn:getUserNick(blogForm.userID)}</a></b></td>
       <td width="64%"><span>${myfn:formatDate14(blogForm.mtime, "-")}</span></td>
       <td width="22%" align="right">
        <c:if test="${blogForm.userID == userID }">
		<a href="${cpath}/blog_delall/blogID_${blogForm.blogID}.html"><img src="${cpath}/images/icon_36.gif" width="14" height="14" /> [删除] </a> 
        <a href="${cpath}/blog_modifyPage/blogID_${blogForm.blogID}_follID_${blogForm.follID}_upFollID_${blogForm.upFollID}.html"><img src="${cpath}/images/icon_37.gif" width="14" height="14" /> [编辑]  </a> 
		</c:if>
        <a href="javascript:doReply('','','')"><img src="${cpath}/images/icon_38.gif" width="14" height="14" /> [回复] </a>
      </td>
     </tr>
     <tr class="bl-detail-content">
       <td height="77" valign="top" class="bl-detail-content-left"><a href="${cpath}/users_home/userID_${blogForm.userID}.html" target="_blank"><img src="${cpath}/${myfn:getUserPic(blogForm.userID)}"  width="51" height="51" class="user_icon_1"></a></td>
       <td colspan="2" class="bl-detail-content-right">${blogForm.content}</td>
     </tr>
     <tr class="bl-detail-content" >
       <td colspan="3" class="bl-detail-content-right"  id='${blogForm.blogID}' style="display:none;padding-left:40px;text-align:center;"></td>
     </tr>

     <c:set value='0' var="pos"/>
     <c:forEach var="follow" items="${followlist}" varStatus="status" begin="0"> 
	 <!--跟帖-->
	 <c:if test="${follow.upFollID == 0}">
	 <c:set value="${1+pos}" var="pos"/>
	 <tr class="bl-detail-top2">
       <td width="14%" height="34" valign="top"><b class="color_red">${pos}楼：${myfn:getUserNick(follow.userID)}</b></td>
       <td width="64%"><span>${myfn:formatDate14(follow.mtime, "-")} 回复</span></td>
       <td width="22%" align="right">&nbsp;</td>
     </tr>
	 </c:if> 
	 <c:if test="${follow.upFollID != 0}">
     <tr class="bl-detail-top2">
       <td width="14%" height="34" valign="top"><b class="color_red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${myfn:getUserNick(follow.upUserID)}</b></td>
       <td width="64%"><span>${myfn:formatDate14(follow.mtime, "-")} 回复 <b class="color_red">${pos}楼</b></span></td>
       <td width="22%" align="right">&nbsp;</td>
     </tr>
	 </c:if> 
	 <tr class="bl-detail-content">
       <td height="77" valign="top" class="bl-detail-content-left"><a href="${cpath}/users_home/userID_${follow.userID}.html" target="_blank"><img src="${cpath}/${myfn:getUserPic(follow.userID)}"  width="51" height="51" class="user_icon_1"></a></td>
       <td colspan="2" class="bl-detail-content-right">
		${follow.content}
      <p class="bl-detail-conten-line">
	  <c:if test="${blogForm.userID == userID }">
        <a href="${cpath}/blog_del/blogID_${blogForm.blogID}_follID_${follow.follID}_upFollID_${follow.upFollID}.html"><img src="${cpath}/images/icon_39.gif" width="16" height="16" /> [删除] </a> 
	  </c:if>
        <a href="javascript:doReply('${follow.follID}','${follow.upFollID}','${follow.userID}');"><img src="${cpath}/images/icon_40.gif" width="16" height="16" /> [回复] </a>
      </p>
      </td>
     </tr>
     <tr class="bl-detail-content" >
       <td colspan="3" class="bl-detail-content-right"  id='${blogForm.blogID}${follow.follID}${follow.upFollID}' style="display:none;padding-left:40px;text-align:center;"></td>
     </tr>

	 </c:forEach>
     <tr class="bl-detail-content" >
       <td colspan="3" class="bl-detail-content-right" >
		<input type='hidden' name='qryBlogID'	value='${blogForm.qryBlogID}'/>
		<input type='hidden' name='blogID'		value='${blogForm.blogID}'/>
		<input type='hidden' name='userID'		value='${userID}'/>
		<input type='hidden' name='follID'		id='follID'		value=''/>
		<input type='hidden' name='upFollID'	id='upFollID'	value=''/>
		<input type='hidden' name='upUserID'	id='upUserID'	value=''/>
		<c:if test="${ theForm.page.totalNum > 0}">
		<!-- 分页主键 formName字段当前的form名称 -->
		<%@ include file="/jsplib/page.jsp" %>
		 </c:if>
		<!--隐藏域-->
		<input type="hidden" name='action' value='info'/>	   
	   </td>
     </tr>
   </table>
   
 </form>

   </div>
   <div class="clearFloat"></div>
  </div>
 </div>
 
    <div class="clearFloat"></div>
 </div> 
 <!--主体 end -->
 
 
 <!--页脚 start -->
	<%@ include file="/foot.jsp"%>
 <!--页脚 end --> 
</div>
<!--外套 end -->

</body>
</html>
<!---->
<script>

    /**
     * 检查项目资料维护
     */
	function doConfirm(act)
	{
		var form = document.theForm;
		var action = form['action'];

		action.value = act;

		if(act == "addcomment"){
			var content = form['content'].value;
			if(content.length > 20000)
			{
				alert('内容长度不能大于20000');
				return ;
			}	
			form['content'].value = gjcfilter(content);
		}
		form.submit();
	}
    /**
     * 检查项目资料维护
     */
	function doCancel()
	{
		if(curreplyID != ""){
			document.getElementById(curreplyID).innerHTML = "";
		}
	}
	function my_getbyid(id)
	{
		 itm = null;
		 if (document.getElementById)
		 {
				itm = document.getElementById(id);
		 }
		 else if (document.all)
		 {
				itm = document.all[id];
		 }
		 else if (document.layers)
		 {
				itm = document.layers[id];
		 }		 
		 return itm;
	}
    /**
     * 检查项目资料维护
     */
	function doReply(varGFollowID,vargupFollID,varupUserID)
	{

		var userID = "${userID}";
		if(userID == ""){
			alert('回复需要登录网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		document.getElementById('follID').value = varGFollowID;
		document.getElementById('upFollID').value = vargupFollID;
		document.getElementById('upUserID').value = varupUserID;

		if(curreplyID != ""){
			my_getbyid(curreplyID).innerHTML = "";
		}
		curreplyID = "${blogForm.blogID}" + varGFollowID + vargupFollID;

		var distxt = "<span class='notice_from' style='width:100%'><p><textarea name='content' rows='' cols=''  class='input'></textarea></p>";
		distxt +=	"	<p>";
		distxt +=	"	<a href='javascript:doConfirm(\"addcomment\");'><img src='${cpath}/images/icon_09.gif' width='83' height='22' /></a> &nbsp; &nbsp; <a href='javascript:doCancel();'><img src='${cpath}/images/icon_45.gif' width='83' height='22' /></a> ";
		distxt +=	"	</p></span>";

		document.getElementById(curreplyID).innerHTML = distxt;

		document.getElementById(curreplyID).style.display = "";
	}

</script>
